import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Random;


public class RandomFileGenerator {
	
	public void generateFile(int amountOfElements, String fileName){
		try {
			BufferedWriter bw = new BufferedWriter(new FileWriter(new File(fileName)));
			Random randomGenerator = new Random();
			for (int i =0; i< amountOfElements; i++){
				bw.write(Integer.toString(randomGenerator.nextInt(300)));
				bw.newLine();
			}
			bw.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}

}
